<?xml version='1.0' encoding='UTF-8' ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:t="http://myfaces.apache.org/tomahawk">
    <head>
    </head>
    <body>
        <ui:composition template="/MenuTemplate_popup_wave.xhtml">
            <ui:define name="content_nav">
                #{msg.content_nav_orderselect}
            </ui:define>
            <ui:define name="content">
                    <h:panelGrid  styleClass="body_content_box" columns="1">
                        <h:form id="searchForm">
                        <h:panelGrid styleClass="search_border" columns="1" cellpadding="0" cellspacing="0">
                            <h:panelGrid styleClass="search_title" columns="1" cellpadding="0"
                                         cellspacing="2">
                                <h:outputLabel value="#{msg.content_title_order_search}"  style="vertical-align: middle"/>
                            </h:panelGrid>
                            <h:panelGrid columns="2" cellspacing="4">
                                <h:panelGrid columns="3" cellpadding="0" border="0" cellspacing="0">
                                    <h:outputLabel value="#{msg.label_order_code}" ></h:outputLabel>
                                    <h:inputText value="#{orderListBean.orderCode}"></h:inputText>
                                    <h:outputLabel styleClass="com_width_50"/>
                                </h:panelGrid>
                                <h:panelGrid columns="3" cellpadding="0" border="0" cellspacing="0">
                                    <h:outputLabel value="#{msg.label_contact_code}"></h:outputLabel>
                                    <h:inputText value="#{orderListBean.contactCode}"></h:inputText>
                                    <h:outputLabel styleClass="com_width_50"/>
                                </h:panelGrid>
                                <h:panelGrid columns="3" cellpadding="0" border="0" cellspacing="0">
                                    <h:outputLabel value="#{msg.label_task_name}"></h:outputLabel>
                                    <h:inputText value="#{orderListBean.taskName}"></h:inputText>
                                    <h:outputLabel styleClass="com_width_50"/>
                                </h:panelGrid>
                                <h:panelGrid cellspacing="0" cellpadding="0" columns="2">
                                    <h:commandButton value="#{msg.bt_search}" action="#{orderListBean.refreshData}"/>
                                    <h:commandButton value="#{msg.bt_reset}" action="#{orderListBean.reset}"/>
                                </h:panelGrid>
                            </h:panelGrid>
                        </h:panelGrid>
                        </h:form>
                    </h:panelGrid>
                    <h:form id="dataForm">
                    <h:panelGrid  styleClass="body_content_box" columns="1">
                        <h:panelGrid styleClass="table_border" columns="1" cellpadding="0" cellspacing="0">
                            <h:panelGrid columns="1" styleClass="table_title"  cellpadding="0"
                                         cellspacing="2">
                                <h:outputLabel value="#{orderListBean.tableTitle}"  style="vertical-align: middle"/>
                            </h:panelGrid>
                            <t:dataTable id="dataTable" value="#{orderListBean.data}"
                                         var="row" rows="#{orderListBean.pageInfo.pageSize}"
                                         headerClass="table_header"
                                         styleClass="mxl"
                                         rowClasses="list-row1-background,list-row2-background"
                                         >
                                <t:column width="2%">
                                    <f:facet name="header">
                                        <h:selectBooleanCheckbox id="multiSelected"
                                                                 value="#{orderListBean.allSelected}"
                                                                 onclick="SetCheckedStatus()"
                                                                 immediate="true">
                                        </h:selectBooleanCheckbox>
                                    </f:facet>
                                    <h:selectBooleanCheckbox value="#{row.selected}"
                                                               immediate="true"
                                                               onclick="CheckAll()">
                                    </h:selectBooleanCheckbox>
                                </t:column>
                                <t:column width="10%">
                                    <f:facet name="header">
                                        <h:outputLabel value="#{msg.label_project_code}"></h:outputLabel>
                                    </f:facet>
                                    <h:outputText value="#{row.projectCode}"/>
                                </t:column>
                                <t:column width="10%">
                                    <f:facet name="header">
                                        <h:outputLabel value="#{msg.label_order_code}"></h:outputLabel>
                                    </f:facet>
                                    <h:outputText value="#{row.orderCode}"/>
                                </t:column>
                                <t:column width="25%">
                                    <f:facet name="header">
                                        <h:outputLabel value="#{msg.label_contact_code}"></h:outputLabel>
                                    </f:facet>
                                    <h:outputText value="#{row.contactCode}"/>
                                </t:column>
                                <t:column width="15%">
                                    <f:facet name="header">
                                        <h:outputLabel value="#{msg.label_task_name}"></h:outputLabel>
                                    </f:facet>
                                    <h:outputText value="#{row.taskName}"/>
                                </t:column>
                                <t:column width="10%">
                                    <f:facet name="header">
                                        <h:outputLabel value="#{msg.label_order_value}"></h:outputLabel>
                                    </f:facet>
                                    <h:outputText value="#{row.orderValue}"/>
                                </t:column>
                                <t:column width="10%">
                                    <f:facet name="header">
                                        <h:outputLabel value="#{msg.label_order_status}"></h:outputLabel>
                                    </f:facet>
                                    <h:outputText value="#{msg.list_item_executing}" rendered="#{row.orderStatus == 1}"/>
                                    <h:outputText value="#{msg.list_item_finished}" rendered="#{row.orderStatus == 2}"/>
                                </t:column>
                            </t:dataTable>
                            <t:dataScroller id="scroll" for="dataTable" rowsCountVar="#{orderListBean.pageInfo.totalCount}"
                                            displayedRowsCountVar="#{orderListBean.pageInfo.displayCount}"
                                            pageCountVar="#{orderListBean.pageInfo.totalPages}"
                                            pageIndexVar="#{orderListBean.pageInfo.currentPage}"
                                            rendered="#{orderListBean.pagable}"
                                            actionListener="#{orderListBean.scrollAction}">
                                <f:facet name="first" >
                                    <h:outputText value="first"/>
                                </f:facet>
                                <f:facet name="last">
                                    <h:outputText value="last"/>
                                </f:facet>
                                <f:facet name="previous">
                                    <h:outputText value="previous"/>
                                </f:facet>
                                <f:facet name="next">
                                    <h:outputText value="next"/>
                                </f:facet>
                                <f:facet name="fastforward">
                                    <h:outputText value="fastforward"/>
                                </f:facet>
                                <f:facet name="fastrewind">
                                    <h:outputText value="fastrewind"/>
                                </f:facet>
                            </t:dataScroller>
                        </h:panelGrid>
                    </h:panelGrid>
                    <h:panelGrid styleClass="body_content_box">
                        <h:commandButton value="#{msg.bt_add}" action="#{orderListBean.selectOrder}" />
                    </h:panelGrid>
                </h:form>
            </ui:define>
        </ui:composition>
    </body>
</html>